package com.cmos.um.web;

import java.util.Map;

import com.cmos.um.iservice.IHolidaySV;
import com.alibaba.dubbo.config.annotation.Reference;
import com.cmos.um.utils.RetMap;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;

@RestController
@RequestMapping("/ngocadapter/ws/campaignService")
public class HolidayController {
    @Reference
    private IHolidaySV iHolidaySV;

    /**
     * 【操作】节假日信息接口
     *
     * @param params 参数集MAP（含params参数――此参数在输入函数时为Json字符串）
     * @return Map<String,Object> 返回的数据（MAP形式）
     */
    @PostMapping("/synchHolidayInfo")
    public Map<String, Object> synchHolidayInfo(@RequestBody JSONObject params) {
        if (params.containsKey("params") && params.containsKey("beans")) {
            return iHolidaySV.synchHolidayInfo(params);
        } else {
            return new RetMap("0", "入参不符合规范!");
        }
    }
}
